package me.zhanshi123.pixelpaygui.gui

import io.izzel.taboolib.util.item.ItemBuilder
import io.izzel.taboolib.util.lite.Materials
import me.zhanshi123.pixelpaygui.ConfigManager
import me.zhanshi123.pixelpaygui.util.Skulls
import org.bukkit.inventory.ItemStack

object CommonGuiUtil {
    lateinit var qq: ItemStack
    lateinit var wechat: ItemStack
    lateinit var alipay: ItemStack
    var close: ItemStack = ItemBuilder(Materials.BARRIER.parseItem()).name("§c关闭").build()
    fun initHeadInventory() {
        qq = ItemBuilder(Skulls.getTextureSkull(ConfigManager.config.getString("head.qq"))).name(ConfigManager.config.getStringColored("items.qq.name")).lore(ConfigManager.config.getStringListColored("items.qq.lore")).build()
        wechat = ItemBuilder(Skulls.getTextureSkull(ConfigManager.config.getString("head.wechat"))).name(ConfigManager.config.getStringColored("items.wechat.name")).lore(ConfigManager.config.getStringListColored("items.wechat.lore")).build()
        alipay = ItemBuilder(Skulls.getTextureSkull(ConfigManager.config.getString("head.alipay"))).name(ConfigManager.config.getStringColored("items.alipay.name")).lore(ConfigManager.config.getStringListColored("items.alipay.lore")).build()
    }

    fun initOptifineInventory() {
        qq = ItemBuilder(Materials.DIAMOND.parseItem()).name(ConfigManager.config.getStringColored("items.qq.name")).lore(ConfigManager.config.getStringListColored("items.qq.lore").let {
            it.add("§2§3§3§0")
            it
        }).build()
        wechat = ItemBuilder(Materials.DIAMOND.parseItem()).name(ConfigManager.config.getStringColored("items.wechat.name")).lore(ConfigManager.config.getStringListColored("items.wechat.lore").let {
            it.add("§2§3§3§1")
            it
        }).build()
        alipay = ItemBuilder(Materials.DIAMOND.parseItem()).name(ConfigManager.config.getStringColored("items.alipay.name")).lore(ConfigManager.config.getStringListColored("item.alipay.lore").let {
            it.add("§2§3§3§2")
            it
        }).build()
    }
}